package com.squirrel.michale;

/**
 * @author guanhao 观浩
 * @version 1.0.0.0
 * @createTime 2023/2/22 12:06 PM
 * @company Michale Squirrel
 * @link
 * @description
 */
public class LeetCode2023 {

    public int numOfPairs(String[] nums, String target) {
        int resultCount = 0;
        int length = nums.length;

        for (int i = 0; i < length; i++) {
            for (int j = 0; j < length; j++) {
                if (i == j || nums[i].length() + nums[j].length() != target.length()) {
                    continue;
                }
                String merge = nums[i] + nums[j];
                if (merge.equals(target)) {
                    resultCount++;
                }
            }
        }
        return resultCount;
    }


    public static void main(String[] args) {
        String[] strArray = new String[]{"777", "7", "77", "77"};

        LeetCode2023 leetCode2023 = new LeetCode2023();
        System.out.println(leetCode2023.numOfPairs(strArray, "7777"));


    }
}
